package com.xqls.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xqls.dal.dao.RolePermissionKeyDao;
import com.xqls.dal.model.RolePermissionExample;
import com.xqls.dal.model.RolePermissionKey;
import com.xqls.dal.service.RolePermissionMapper;

@Repository
public class RolePermissionKeyDaoImpl implements RolePermissionKeyDao {

	@Autowired private RolePermissionMapper rolePermissionMapper;

	@Override
	public boolean deleteById(String roleId) {
		boolean isResult=false;
		if(this.rolePermissionMapper.deleteById(roleId)>0)
		{
			isResult=true;
		}
		return isResult;
	}

	@Override
	public boolean insertByList(List<RolePermissionKey> list) {
		boolean isResult=false;
		if(this.rolePermissionMapper.insertByList(list)>0)
		{
			isResult=true;
		}
		return isResult;
	}
	
	@Override
	public boolean updateRecord(RolePermissionKey record,RolePermissionExample example) {
		boolean isResult=false;
		if(this.rolePermissionMapper.updateByExample(record, example)>0)
		{
			isResult=true;
		}
		return isResult;
	}
	
	@Override
	public boolean deleteRecord(RolePermissionKey key) {
		boolean isResult=false;
		if(this.rolePermissionMapper.deleteByPrimaryKey(key)>0)
		{
			isResult=true;
		}
		return isResult;
	}
	
	@Override
	public boolean deleteByList(List<RolePermissionKey> list) {
		boolean isResult=false;
		if(this.rolePermissionMapper.deleteByList(list)>0)
		{
			isResult=true;
		}
		return isResult;
	}
	
	@Override
	public boolean deleteByMap(Map<String, Object> map) {
		boolean isResult=false;
		if(this.rolePermissionMapper.deleteByMap(map)>0)
		{
			isResult=true;
		}
		return isResult;
	}
	
	@Override
	public RolePermissionKey getLastRecord() {
		return this.rolePermissionMapper.getLastRecord();
	}
	
	@Override
	public List<RolePermissionKey> getList(RolePermissionExample example) {
		return this.rolePermissionMapper.selectByExample(example);
	}
	
	@Override
	public List<Map<String,Object>> getListByMap(Map<String, Object> map) {
		return this.rolePermissionMapper.getListByMap(map);
	}

	@Override
	public List<Map<String, Object>> getMenuByMap(Map<String, Object> map) {
		return this.rolePermissionMapper.getMenuByMap(map);
	}
}
